package de.urlaub.server.data;

import javax.ejb.Stateless;
import javax.interceptor.Interceptors;

import de.urlaub.server.comm.HornetQSender;
import de.urlaub.server.logging.LoggingInterceptor;

@Stateless
@Interceptors(LoggingInterceptor.class)
public class VacationTableUtil implements VacationTableUtilRemote
{	
	@Override
	public String[] getColumnNames(boolean showExtendedView)
	{
		String[] columnNames;
		
		if (showExtendedView)
			columnNames = new String[4];
		else
			columnNames = new String[3];
		
		int i = 0;
		if (showExtendedView)
		{
			columnNames[i] = "Mitarbeiter";
			i++;
		}
		columnNames[i] = "Von";
		i++;
		columnNames[i] = "Bis";
		i++;
		columnNames[i] = "Status";
		
		return columnNames;
	}
	
	@Override
	public Object[][] getData(String query)
	{
		// TODO: umaendern ... ArrayList mit Vacations kommt rein
		Object[][] data = new Object[1][1];
		
		if (query != null )
			data[0] = new Object[] 
			{
				1,
				"Tobias Dehn", 
				"18.09.2012",
				"20.09.2012",
				"Offen"
			};
		else
			data[0]= new Object[] 
			{
				1,
				"18.09.2012",
				"20.09.2012",
				"Offen"
			};
		
		return data;
	}
}
